package com.java110.mall.shop.cmd.community;

import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.intf.user.IWuyeV1InnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;

@Java110Cmd(serviceCode = "community.listCommunitys")
public class ListCommunitysCmd extends Cmd {

    @Autowired
    private IWuyeV1InnerServiceSMO wuyeV1InnerServiceSMOImpl;


    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        super.validatePageInfo(reqJson);
    }

    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {

       ResultVo resultVo = wuyeV1InnerServiceSMOImpl.getCommunitys(reqJson);

       context.setResponseEntity(ResultVo.createResponseEntity(resultVo));

    }
}
